import { useState } from "react"
import useToggle from "./useToggle"

export default <T>(
  fetch: () => Promise<T>,
) => {
  const [data, setData] = useState<T>()
  const [error, setError] = useState<string>();
  const [loading, {open: openLoading, close: closeLoading}] = useToggle();

  return [data]
}
